package com.ruoyi.web.controller.points;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.points.service.IUserCheckinService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;

/**
 * 用户签到Controller
 *
 * @author 区嘉盛
 * @date 2025-06-20
 */
@RestController
@RequestMapping("/points/checkin")
@Tag(name = "【用户签到】管理")
public class UserCheckinController extends BaseController {

    @Autowired
    private IUserCheckinService userCheckinService;

    /**
     * 用户签到
     */
    @Operation(summary = "用户签到")
    @PostMapping("/doCheckin")
    public AjaxResult doCheckin() {
        Long userId = SecurityUtils.getUserId();
        return userCheckinService.doCheckin(userId);
    }
}